草庐IT

low-code engine

全部标签

别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!

背景你还在用System.currentTimeMillis...统计耗时?比如下面这段代码:/***@author:栈长*@from:公众号Java技术栈*/@TestpublicvoidjdkWasteTime()throwsInterruptedException{longstart=System.currentTimeMillis();Thread.sleep(3000);System.out.printf("耗时:%dms.",System.currentTimeMillis()-start);}System.currentTimeMillis...这种方式统计耗时确实是用的最多的,

别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!

背景你还在用System.currentTimeMillis...统计耗时?比如下面这段代码:/***@author:栈长*@from:公众号Java技术栈*/@TestpublicvoidjdkWasteTime()throwsInterruptedException{longstart=System.currentTimeMillis();Thread.sleep(3000);System.out.printf("耗时:%dms.",System.currentTimeMillis()-start);}System.currentTimeMillis...这种方式统计耗时确实是用的最多的,